package com.egg.basic.controller.web;

import com.egg.common.core.model.controller.WebController;
import com.egg.common.core.model.response.ResponseData;
import com.egg.common.util.IpUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author east
 */
@Slf4j
@Api(tags = WebController.API_PREFIX + "监控中心")
@RestController
@RequestMapping("/monitor")
public class WebMonitorController extends WebController {


    @ApiOperation(value = "admin 监控服务")
    @GetMapping("/admin/server")
    public ResponseData<String> monitorAdminServer() {
        String serverIp = IpUtil.serverIp();
        return ResponseData.success("http://" + serverIp + ":9186/wallboard");
    }

    @ApiOperation(value = "zipkin 监控服务")
    @GetMapping("/zipkin/server")
    public ResponseData<String> monitorZipkinServer() {
        String serverIp = IpUtil.serverIp();
        return ResponseData.success("http://" + serverIp + ":9411/zipkin");
    }


}
